<template>
	<view class="h100 fl-cc">
		<view class="mgb">
			<image mode="aspectFit" src='/static/location.png' alt="empty icon" />
		</view>
		<view class="fl loading-text">
			<text v-for="(item,index) in loadingTxt" :key="index" class="mgr5 textitem">{{item}}</text>
		</view>
	</view>
</template>

<script setup>
	const props = defineProps({
		isLoading:{
			type: Boolean,
			default: true
		} 
	});
	const loadingTxt = "加载中请稍等...";
</script>

<style lang="scss">
	.loading-text {
		display: inline-block;
		/* 让容器适应内容宽度 */
		font-size: 16px;
		/* 设置字体大小 */
		line-height: 1.5;
		/* 设置行高 */
	}

	.loading-text .textitem {
		display: inline-block;
		/* 让每个字符都可以独立动画 */
		animation: jump 0.5s infinite alternate;
		/* 应用动画 */
	}

	@keyframes jump {
		from {
			transform: translateY(0);
		}

		to {
			transform: translateY(-10px);
		}
	}

	.loading-text .textitem:nth-child(odd) {
		animation-delay: 0.1s;
	}

	.loading-text .textitem:nth-child(even) {
		animation-delay: 0.2s;
	}

	.loading-text .textitem:nth-child(1) {
		animation-delay: 0s;
	}

	.loading-text .textitem:nth-child(2) {
		animation-delay: 0.05s;
	}

	.loading-text .textitem:nth-child(3) {
		animation-delay: 0.1s;
	}
</style>